package com.glink.manage.dto.person;

import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.glink.common.serializer.JsonDate3DeSerializer;
import com.glink.common.serializer.JsonDate3Serializer;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.io.Serializable;
import java.util.Date;
import java.util.List;

/**
* @author  qiushaoshan
* @since 2025-01-13
*/
@ApiModel(value="PersonManageSaveDTO对象", description="人员管理-新增")
@Data
@AllArgsConstructor
@NoArgsConstructor
public class PersonManageSaveDTO implements Serializable {

    private static final long serialVersionUID = -1771466246009069494L;

    @ApiModelProperty(value = "用户身份证号")
    @Size(max = 20, message = "用户身份证号不能超过20个字符")
    @NotBlank(message = "身份证号不能为空")
    private String card;

    @ApiModelProperty(value = "姓名")
    @Size(max = 200, message = "用户姓名不能超过200个字符")
    @NotBlank(message = "姓名不能为空")
    private String name;

    @ApiModelProperty(value = "用户性别,code:UserSex")
    @Size(max = 2, message = "用户性别不能超过2个字符")
    private String sex;

    @ApiModelProperty(value = "用户生日;yyyy-MM-dd")
    @JsonSerialize(using = JsonDate3Serializer.class)
    @JsonDeserialize(using = JsonDate3DeSerializer.class)
    private Date birth;

    @ApiModelProperty(value = "所属单位")
    @Size(max = 42, message = "所属单位信息有误")
    @NotBlank(message = "姓名不能为空")
    private String orgId;

    @ApiModelProperty(value = "人员类型:code:PersonType")
    @Size(max = 10, message = "人员类型不能超过10个字符")
    private String type;

    @ApiModelProperty(value = "人脸照片")
    @Size(max = 200, message = "人脸照片不能超过200个字符")
    private String profilePicture;

    @ApiModelProperty(value = "健康证")
    @NotBlank(message = "必须上传健康证")
    private String healthCert;

    @ApiModelProperty(value = "资质证书")
    private List<PersonCertSaveDTO> certList;

    @ApiModelProperty(value = "培训记录")
    @NotNull(message = "必须存在培训记录")
    private List<PersonTrainingRecordSaveDTO> trainingRecordList;

    @ApiModelProperty(value = "违章记录")
    private List<PersonViolationRegulationsRecordSaveDTO> violationRegulationsRecordList;

    @ApiModelProperty(value = "登录用户账号信息")
    private PersonAccountInfoDTO accountInfo;
}
